﻿@model IEnumerable<Pypin.empresa>

@{
    ViewBag.Title = "Index";
}

<h2>Empresas</h2>

<p>
    @Html.ActionLink("Crear nueva", "Create")
</p>

@{
    ViewBag.Title = "Empresas";

    var grid = new WebGrid(
        source: Model,
        rowsPerPage: 4);
        
}


@grid.GetHtml(
    columns: grid.Columns (
        grid.Column("Nombre", "Nombre"),
        grid.Column("Direccion", "Dirección"),
        grid.Column("Telefono", "Teléfono"),
        grid.Column("EMail", "EMail"),
        grid.Column("RUC", "RUC"),
        grid.Column("Borrado", "Borrado"),
        grid.Column(header: "",
                   style: "text-align-center",
                   format: (item) => new
                   HtmlString(Html.ActionLink("Edit", "Edit", new { ID = item.IdEmpresa     }).ToString() + " | " +
                       Html.ActionLink("Details", "Details", new { ID = item.IdEmpresa }).ToString() + " | " +
                       Html.ActionLink("Delete", "Delete", new { ID = item.IdEmpresa }).ToString()
                              )
                   )
    )                   
)

